package com.wsfk.ssm.tools;

import org.apache.log4j.Logger;
import org.apache.struts2.json.JSONException;
import org.apache.struts2.json.JSONUtil;

/**
 * 
 * @author zhangbao
 *
 */
public class JsonUtil {

	static Logger errorLog =Logger.getLogger("errorfile");
	
	public static String jsonStringForObject(Object obj){
		
		String jsonStirng=null;
		try {
			jsonStirng =JSONUtil.serialize(obj);
		} catch (JSONException e) {
			errorLog.error("----JsonUtil jsonStringForObject\n"+e.getMessage());
		}
		return jsonStirng;
	}
}
